{# Reusable template card partial for label templates (simple variant) #}
{# Usage: {% include 'assets/partials/template_card.html' with template=template %} #}

<div class="template-card {% if template.is_default %}default{% endif %} {% if template.is_public %}public{% endif %}">
    <div class="template-header">
        <h5 class="template-title">{{ template.name }}</h5>
        <div class="template-badges">
            {% if template.is_default %}
                <span class="badge bg-success">默认</span>
            {% endif %}
            {% if template.is_public %}
                <span class="badge bg-info">公共</span>
            {% endif %}
            {% if template.created_by == request.user %}
                <span class="badge bg-secondary">我的</span>
            {% endif %}
        </div>
    </div>
    
    {% if template.description %}
        <p class="text-muted mb-3">{{ template.description }}</p>
    {% endif %}
    
    <div class="template-config">
        <div class="config-item">
            <i class="fas fa-ruler me-1"></i>
            <strong>尺寸:</strong> {{ template.get_label_size_display }}
        </div>
        <div class="config-item">
            <i class="fas fa-th me-1"></i>
            <strong>布局:</strong> {{ template.labels_per_page }}个/页
        </div>
        <div class="config-item">
            <i class="fas fa-qrcode me-1"></i>
            <strong>二维码:</strong> {% if template.include_qr %}是{% else %}否{% endif %}
        </div>
        <div class="config-item">
            <i class="fas fa-tags me-1"></i>
            <strong>类别:</strong> {% if template.include_category %}是{% else %}否{% endif %}
        </div>
        <div class="config-item">
            <i class="fas fa-building me-1"></i>
            <strong>部门:</strong> {% if template.include_department %}是{% else %}否{% endif %}
        </div>
        <div class="config-item">
            <i class="fas fa-user me-1"></i>
            <strong>使用人:</strong> {% if template.include_user %}是{% else %}否{% endif %}
        </div>
    </div>
    
    {% include 'assets/partials/template_actions_list.html' with template=template %}
    
    <div class="mt-2">
        <small class="text-muted">
            <i class="fas fa-user me-1"></i>{{ template.created_by.username }}
            <i class="fas fa-clock me-1 ms-3"></i>{{ template.created_at|date:"Y-m-d H:i" }}
        </small>
    </div>
</div>
